package com.ap.core.validation.message.rules;

import com.ap.core.message.managepayment.info.ConfirmPaymentRequestMessageInfo;
import com.ap.core.validation.message.info.MessageValidationInfo;
import com.ap.core.validation.message.info.RTPOriginalInfoForConfirmPayment;
import com.ap.core.validation.rules.AbstractValidationRule;

/**
 * User:Rohit.Dixit
 * The element Total Payment Request Amount must be valid with its associated order Payment amount.
 */
public class RV0019Rule extends AbstractValidationRule<MessageValidationInfo<ConfirmPaymentRequestMessageInfo, RTPOriginalInfoForConfirmPayment>> {

	@Override
	public boolean validate(MessageValidationInfo<ConfirmPaymentRequestMessageInfo, RTPOriginalInfoForConfirmPayment> infoObject) {
       
		return infoObject.getOriginalInfo().getTotalPaymentRequestAmount().getValue().equals(infoObject.getBoundObject().getPaymtDetails().getPaymentStatusInfo().getTotalPaymentReqAmount());
		
	}

}

